package vknob;

/** Model for the values of a VKnob.
 * Bijective transformation knobPosition <--> value */
public interface VKnobModel {
  /**
   * This function is called whenever the knob is turned.
   *
   * @param position A number between 0.0 (min) and 1.0 (max).
   * @return The value of the knob at this postition.
   * @pre position >= 0 && position <= 1
   * @post for any float x,
   *       getValueAtPosition(getPositionOfValue(x)) == x
   */
  public Object getValueAtKnobDirection(float position);
  /**
   * The inverse of getValueAtKnobDirection. This function is
   * called when the user calls setValue on the knob.
   *
   * @param value A valid value of the knob.
   * @return A number between 0.0 and 1.0.
   * @post for any float x,
   *       getValueAtPosition(getPositionOfValue(x)) == x
   */
  public float getKnobDirectionOfValue(Object value);
}
